package com.library.service;

import com.library.dao.UserMapper;
import com.library.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/6/11.
 */
@Service("UserService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(String studentid, String password) {

        Map<String,Object> map = new HashMap<>();
        if (studentid != null && password != null){
            map.put("studentId",studentid);
            map.put("password",password);
        }
        return userMapper.selectByStudentIdAndPwd(map);
    }

}
